# -*- coding: utf-8 -*-
# Version:python3.7
# Date:2020/6/3 14:24
import base64,io,xlwt
from odoo import api, fields, models, _
class WizardDelRecord(models.TransientModel):
    _name = "wizard.delete.record"
    _description = "批量删除"

    message = fields.Text(string="提示", default="确定要删除该条记录?")
    def del_btn_comfirm(self):
        del_ids = self._context.get("ids", [])
        model_name = self._context.get("modelName")
        view_id = self._context.get("viewId")
        view_type = self._context.get("viewType")
        if del_ids and len(del_ids)>0:
            self.env[model_name].sudo().browse(del_ids).unlink()
            # objs.unlink()
        return {
            'name':self.env[model_name]._description,
            'type': 'ir.actions.act_window',
            'res_model': model_name,
            'views':[[False,'tree'],[False,'form']],
            'target':'main',
            'context': dict(
                self.env.context,
            ),
        }

        # return {"type": "ir.actions.act_window_close"}